package com.xzz.finger;

/**
 * @author: hhz
 * @create: 2022-02-18 15:00
 * 剑指 Offer 27. 二叉树的镜像
 **/
public class MirrorTree {
    public static void main(String[] args) {

    }
    public static TreeNode mirrorTree(TreeNode root) {
        if(root!=null){
            TreeNode temp = root.left;
            root.left = root.right;
            root.right = temp;
            mirrorTree(root.left);
            mirrorTree(root.right);
        }
        return root;
    }
}
